package com.dcy.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dcy.common.ResultEnum;
import com.dcy.common.ResultUtil;
import com.dcy.entity.TbHotel;
import com.dcy.service.TbHotelService;
import com.dcy.vo.TbHotelVo;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * (TbHotel)表控制层
 *
 * @author makejava
 * @since 2024-12-04 11:31:28
 */
@RestController
@RequestMapping("/tbHotel")
@RequiredArgsConstructor
public class TbHotelController {

    private final TbHotelService tbHotelService;

    @GetMapping("/all")
    public ResultUtil<List<TbHotelVo>> getList(HttpServletRequest request, @RequestBody TbHotelVo vo) {
        Page<TbHotelVo> page = new Page<>(vo.getPageIndex(), vo.getPageSize());
        List<TbHotelVo> list = tbHotelService.getList(page,vo);
        return ResultUtil.build(list, ResultEnum.SUCCESS);
    }



}

